﻿using Autofac;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Module = Autofac.Module;

namespace QuartzServiceApp
{
    public class AutofacModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
               .Where(t => typeof(IJob).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract)
                .AsImplementedInterfaces()
                .AsSelf();
            //把服务的注入规则写在这里
            //builder.RegisterType<TestService>().As<ITestService>();
        }
    }
}
